<?php
/**
 * 
 * @todo description of this class
 * 
 * @author Alton Crossley <crossleyframework@nogahidebootstrap.com>
 * @package Crossley Framework
 *  
 * @copyright Copyright (c) 2003-2009, Nogaide BootStrap INC. All rights reserved.
 * @license BSD http://opensource.org/licenses/bsd-license.php
 * @version $Id:$
 * 
 */

/**
 * @namespace
 */
namespace X;

/**
 * simple logger interface allowing for closer testing
 * @author drydenmaker
 *
 */
interface Logger
{
	/**
	 * log a message with an optional message type
	 * @param string $message
	 * @param string $MessageType
	 */
	public function logMessage($message, $MessageType = null);
	/**
	 * log a message on successful completion of a closure
	 * NOTE: Exception should not be swallowed
	 * @param Closure $Action
	 * @param string $SuccessMessage
	 */
	public function onCompletion(\Closure $Action, $SuccessMessage);
	/**
	 * try a closure and log if it fails or succeeds with the given messages
	 * NOTE: Exception should be logged and not rethrown
	 * @param Closure $Action
	 * @param string $SuccessMessage
	 * @param string $FailureMessage
	 */
	public function tryCall(\Closure $Action, $SuccessMessage, $FailureMessage);
	/**
	 * log if a closure fails
	 * NOTE: Exception should be logged and not rethrown
	 * @param Closure $Action
	 * @param string $FailureMessage
	 */
	public function tryFailure(\Closure $Action, $FailureMessage); 
}